import React, { Component } from "react";
import { withRouter } from "../../router/hooks";
import "./login.less";
import { withTranslation } from "react-i18next";

class Login extends Component {
  constructor(props) {
    super(props);
    this.state = {};
  }
  render() {
    const {t} = this.props;
    return (
      <div className="login">
        <div className="login_main">
          <div className="button" onClick={this.loginHandle}>
            {t('Login')}
          </div>
        </div>
      </div>
    );
  }
  loginHandle = (e) => {
    e.preventDefault();
    localStorage.setItem("Token", "111111");
    let url = this.props.history.get("source");
    console.log(url);
    window.location.href = url;
    /* this.props.history.push({
      pathname: url,
    }); */
  };
}

export default withRouter(withTranslation()(Login));
